{% extends "home/home.html" %}
{% block content %}
    <div id="main-wrapper">
        <div class="container">
            <div id="content">
                <form id="form" method="post" enctype="multipart/form-data">{{ form.csrf_token }}
                    {{ form.select.label }}{{ form.select }}
                    {{ form.query.label }}{{ form.query }}
                    {% for err in form.query.errors %}
                         <p class="text-danger">{{ err }}
                    {% endfor %}
                    <br>{{ form.submit }}<br>
                    {% for msg in get_flashed_messages(category_filter=["ok"]) %}
                        <p class="btn-success">{{ msg }}</p>
                    {% endfor %}
                </form>
                {% if type != None %}
                    <hr>
                    {% if type == "specie" %}
                        {% for each in res %}
                            KEGG ID: {{ each.kegg_id }}<br>
                            SPECIE NAME: {{ each.specie_name }}<br>
                            GENE: <a href="{{ url_for('home.specie_gene',_id=each.kegg_id) }}" class="btn btn-info icon fa-table">click here</a><br>
                            <hr>
                        {% endfor %}
                    {% else %}
                        {% for each in res %}
                            SRR ID: {{ each._id }}<br>
                            KEGG ID: {{ each.kegg_id }}<br>
                            METHOD: {{ each.method }}<br>
                            OPERON: <a href="{{ url_for('home.srr_task_operon',_id=each._id) }}" class="btn btn-info icon fa-table">operon list</a><br>
                            DOWNLOAD: <a href="{{ url_for('home.download', _id=each._id) }}" class="btn btn-info icon fa-table">download operon file</a><br>
                            JBROWSE: <a href="{{ each.browse_link }}" class="btn btn-info icon fa-table">jbrowse</a>
                        {% endfor %}
                    {% endif %}
                    <hr>
                {% else %}
                {% endif %}
            </div>
        </div>
    </div>
{% endblock %}